package com.socct.jetpackdemo.room

import androidx.room.*

@androidx.room.Dao
interface DaoImpl : Dao<Person, Long> {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    override fun insert(t: Person)

    @Update
    override fun update(t: Person)

    @Delete
    override fun delete(t: Person)

    @Delete
    override fun deleteById(key: Long)

    @Query("select *from Person where id=(:key)")
    override fun queryById(key: Long)

    @Query("SELECT * FROM Person WHERE id IN (:userIds)")
    fun loadAllByIds(userIds: IntArray): List<Person>

    @Query("select *from Person")
    override fun queryAll(): List<Person>


}